/*
 * ntputil.h
 *
 *  Created on: 06.06.2012.
 *      Author: Aco
 */

#ifndef NTPUTIL_H_
#define NTPUTIL_H_

#define MY_NTP_VERSION (3)

#include "types.h"
#include "ntppacket.h"

NTPpack * ntp_createPacket();

void ntp_packetInfo(NTPpack *np);
void ntp_formatTime32(NTPtime32 nt, char * buffer);
void ntp_formatTime64(NTPtime64 nt, char * buffer);
void ntp_printTime32(NTPtime32 nt);
void ntp_printTime64(NTPtime64 nt);

NTPtime64 ntp_getCurrentTime();
int ntp_getMiliseconds(NTPtime64 * nt);

Uint32 ntp_reverseBytes32(Uint32 src);
Uint16 ntp_reverseBytes16(Uint16 src);

#endif /* NTPUTIL_H_ */
